#!/usr/bin/env python
# encoding: utf-8
# @author: Lin Han
# @contact: voldemort22@126.com
# @file: queryModels.py
# @time: 2021/4/12 11:30
# @desc:
from datetime import datetime
from typing import List, Optional

from pydantic import BaseModel


class MultipleConditionQuery(BaseModel):
    """
    多条件组合查询历史夹具信息
    """
    area: Optional[str]
    hasPin: Optional[bool]
    hasStopBlock: Optional[bool]
    keyword: Optional[str]
    # numbers: Optional[List[Dict[str, str]]]
    numbers: Optional[List[str]]
    standard: Optional[str]

    startTime: Optional[datetime] = datetime.strptime("2000-01-01", "%Y-%m-%d")
    endTime: Optional[datetime] = datetime.strptime("3000-01-01", "%Y-%m-%d")
    page: Optional[int] = 1
    pagesize: Optional[int] = 10
    isTotal: Optional[bool] = False
    isFeature: Optional[bool]
    isFlag: Optional[bool]


class UploadHistoryClampModel(BaseModel):
    catpartAliOssAddress: str
    workpieceCatpartAliOssAddress: Optional[str] = None

class KeywordFilter(BaseModel):

    keyword: Optional[str]
    standard: Optional[str]
    area: Optional[str]
    isFeature: Optional[bool]
    isFlag: Optional[bool]
    isSceneBinded: Optional[bool]
    hasPin: Optional[bool]
    hasStopBlock: Optional[bool]
    # 如果入参里这个字段非空，即传入一堆number号，输出的数据中必须在这些number号中
    rpsNumber: Optional[int]
    rpsType: List = []
    numbers: Optional[List[str]]
